Demo - Reading the Output Files
A successful EnergyPlus simulation run will generate a series of EnergyPlus output files.
1>>> from eprun import runsim
2>>> result=runsim(ep_dir=r'C:\EnergyPlusV9-6-0',
3>>> input_filepath='1ZoneUncontrolled.idf',
4>>> epw_filepath='USA_CO_Golden-NREL.724666_TMY3.epw',
5>>> sim_dir='simulation_results')
6>>> print(type(epresult))
7<class 'eprun.epresult.EPResult'>
8>>> print(list(epresult.files.keys())) # This prints the output file extensions
9['audit', 'bnd', 'dxf', 'eio', 'end', 'err', 'eso', 'mdd', 'mtd', 'mtr',
10 'rdd', 'shd', 'csv', 'htm', 'tab', 'txt', 'xml']
The EnergyPlus output files are text files and can be read with the Python built-in open method.
However the format of the text files is non-standard so additional processing is almost always required.
eprun contains the following classes for reading EnergyPlus output files:
These classes can be created directly or by using the get_[output_file_extension] methods of the EPResult object.
The simplest output file is the ‘.end’ file which contains a single line of information.
This is accessed using the get_end method which returns a EPEnd object instance.
11>>> end=epresult.get_end()
12>>> print(type(end))
13<class 'eprun.epend.EPEnd'>
14>>> print(end.line) # The single line of the file
15EnergyPlus Completed Successfully-- 0 Warning; 0 Severe Errors; Elapsed Time=00hr 00min 2.21sec
A slightly more complex output file is the ‘.err’ file which records an errors encountered during the simulation run.
This is accessed using the get_err method which returns a EPErr object instance.
16>>> err=epresult.get_err()
17>>> print(type(err))
18<class 'eprun.eperr.EPErr'>
19>>> print(err.lines)
20Program Version,EnergyPlus, Version 9.6.0-f420c06a69, YMD=2022.03.09 06:13,
21************* Testing Individual Branch Integrity
22************* All Branches passed integrity testing
23************* Testing Individual Supply Air Path Integrity
24************* All Supply Air Paths passed integrity testing
25************* Testing Individual Return Air Path Integrity
26************* All Return Air Paths passed integrity testing
27************* No node connection errors were found.
28************* Beginning Simulation
29************* Simulation Error Summary *************
30************* EnergyPlus Warmup Error Summary. During Warmup: 0 Warning; 0 Severe Errors.
31************* EnergyPlus Sizing Error Summary. During Sizing: 0 Warning; 0 Severe Errors.
32************* EnergyPlus Completed Successfully-- 0 Warning; 0 Severe Errors; Elapsed Time=00hr 00min 0.64sec
Another output file is the ‘.eso’ file which contains the results of the simulation calculations. Instructions on how to view these results is described in the tutorial Reading the eso Output File.
Congratulations! You now know how to run an EnergyPlus simulation using the runsim function
and how to access the simulation results and output files using the EPResult class.
Further resources
The documentation for:
the EPResult class
the EPEnd class
the EPErr class
the EPEso class
The ‘Viewing the results of the 1ZoneUncontrolled simulation run’ Jupyter Notebook shows the EPResult class in action.
The EnergyPlus QuickStart guide: https://energyplus.net/quickstart
Section ‘3.8 What Are All These Output Files?’ in the EnergyPlus Essentials documentation.